package com.tzj.pic;

import com.tzj.tg.BasePicture;
import com.tzj.tg.Blockable;
import com.tzj.tg.Config;
import com.tzj.tg.Destroyable;
import com.tzj.tg.Hitable;

/**
 * @author honeyrr
 * 水
 */
public class Water extends BasePicture implements Blockable, Hitable, Destroyable {

	private int blood = 4;

	public Water(int x, int y) {
		super(x, y);
		int[] size = Config.getImgSize(Config.WATER);
		this.width = size[0];
		this.height = size[1];
	}

	@Override
	protected void draw() {
		Config.draw(Config.WATER, x, y);
	}

	@Override
	public Blast showBlast() {
		this.blood--;
		Blast blast = new Blast(this, this.blood <= 0);
		return blast;
	}

	@Override
	public boolean isDestroyed() {
		return this.blood  <= 0;
	}
}
